Migrations are a solution to the problem of managing database versions. A migration captures the set of actions required to update a database from one version to the next—which might include schema changes such as widening or adding columns and/or data changes such as computing defaults for new columns—and to roll that same database back to its original state.

Capturing migrations as artifacts makes it easier and more reliable to apply the changes to multiple physical databases (development, test, staging and production) with high confidence that the same set of changes is being applied each time—because it worked in staging, it will work in production.

Being able to roll migrations backwards as well as forwards is important for acceptance testing and staging environments. For example, if staging fails, you will want to revert it to its previous status. But you may not want to rebuild the entire environment from scratch. Running migrations in reverse enables this.

The NHibernate Designer’s migrations framework provides you with:

Database Support

Migrations are not supported on Amazon SimpleDB.

Some databases do not support all migration actions. For example, SQLite does not support adding a foreign key column to an existing table. In addition, some features are not currently implemented on DB2, SQL Server Compact Edition and VistaDB.